﻿package morn.core.managers
{
    import __AS3__.vec.*;
    import morn.core.handlers.*;

    public class ResInfo extends Object implements IDestroy
    {
        public var url:String;
        public var type:int;
        public var priority:int;
        public var data:Object;
        public var completeHandlers:Vector.<Handler>;
        public var progressHandlers:Vector.<Handler>;
        public var errorHandlers:Vector.<Handler>;
        public var isCacheContent:Boolean;
        public var loader:ResLoader;

        public function ResInfo()
        {
            this.completeHandlers = new Vector.<Handler>;
            this.progressHandlers = new Vector.<Handler>;
            this.errorHandlers = new Vector.<Handler>;
            return;
        }// end function

        public function destroy() : void
        {
            this.url = null;
            this.type = 0;
            this.priority = 0;
            this.data = null;
            if (this.completeHandlers)
            {
                this.completeHandlers.length = 0;
                this.completeHandlers = null;
            }
            if (this.progressHandlers)
            {
                this.progressHandlers.length = 0;
                this.progressHandlers = null;
            }
            if (this.errorHandlers)
            {
                this.errorHandlers.length = 0;
                this.errorHandlers = null;
            }
            this.isCacheContent = false;
            this.loader = null;
            return;
        }// end function

    }
}
